Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Defining a pop-up menu

Nearly any visual object, with a few exceptions such as images and rectangles, can have a pop-up menu that you activate with the right mouse button. The pop-up menu uses the same syntax as the menu bar, except that you omit the keyword MENUBAR:

DEFINE MENU menu-name 
    [ { LIKE other-menu } | menu-element-descriptor . . . ]. 

Pop-up menus can contain menu items, submenus, rules, and skips.

To define a pop-up menu in the sample window:

  1. Go into the object’s property sheet and select the Pop-Up Menu button . This brings up the same menu property sheet as before.
  2. Define a pop-up menu for the Order browse and call it m_OrderBrowse.
  3. Define menu items called By OrderNum, By OrderDate, By ShipDate, and By PO.
  4. Following these items, add a RULE.
  5. Add one more item called No ShipDate:
  6. Define a CHOOSE trigger for each item.
  7. For the first four menu items, you want to sort the Orders by the appropriate field by reopening the Order query with a different BY clause. This is the trigger for By_OrderNum:

    DO: 
      OPEN QUERY OrderBrowse FOR EACH Order OF Customer  
           BY Order.OrderNum.  
    END. 
    

  8. Define similar triggers for BY OrderDate, BY PO, and BY ShipDate.
  9. For the final item, you want to filter the query to show only those Orders with no ShipDate:
  10. DO: 
      OPEN QUERY OrderBrowse FOR EACH Order OF Customer  
           WHERE Order.ShipDate = ?. 
    END. 
    

  11. To try out your new pop-up menu, Run the window and then right-click on the browse to bring up the pop-up:

Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095